﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="gridview.aspx.cs" Inherits="C1WijmoProManagement.gridview" %>

<%@ Register Assembly="C1.Web.Wijmo.Controls.4" Namespace="C1.Web.Wijmo.Controls.C1GridView"
    TagPrefix="wijmo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript" src="Scripts/jquery-1.7.1.js"></script>
    <style type="text/css">
        .wijmo-wijgrid-headerrow
        {
            height:30px;
            }
    </style>
    <script type="text/javascript">
        $.ready = function () {
            $(".wijmo-wijgrid-headerrow").removeClass();
            $(".ui-widget").css("font-size", "1em");
        }

    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <wijmo:C1GridView ID="C1GridView1" runat="server" AllowColMoving="True" 
            AllowColSizing="True" AllowPaging="True" AllowSorting="True" 
            AutogenerateColumns="False" DataKeyNames="ID" 
            DataSourceID="AccessDataSource1" ShowFilter="True" ShowFooter="True" ShowGroupArea="True" 
            Width="100%" ToolTip="数据源中表格控件-C1GridView" 
            onrowediting="C1GridView1_RowEditing" PageSize="13" GroupIndent="10" 
            style="top: 0px; left: 0px; height: 494px">
            <PagerSettings Position="TopAndBottom" />
            <Columns>
                <wijmo:C1BoundField DataField="日期" HeaderText="日期" 
                    SortExpression="日期">
                </wijmo:C1BoundField>
                <wijmo:C1BoundField DataField="产品" HeaderText="产品" SortExpression="产品">
                </wijmo:C1BoundField>
                <wijmo:C1BoundField DataField="数量" HeaderText="数量" SortExpression="数量">
                </wijmo:C1BoundField>
                <wijmo:C1BoundField DataField="收入" HeaderText="收入" SortExpression="收入">
                </wijmo:C1BoundField>
                <wijmo:C1BoundField DataField="区域" HeaderText="区域" SortExpression="区域">
                </wijmo:C1BoundField>
                <wijmo:C1BoundField DataField="销售经理" HeaderText="销售经理" SortExpression="销售经理">
                </wijmo:C1BoundField>
                <wijmo:C1CommandField ShowEditButton="True" HeaderText="编辑">
                </wijmo:C1CommandField>
                <wijmo:C1CommandField ShowDeleteButton="True" HeaderText="删除">
                </wijmo:C1CommandField>
            </Columns>
        </wijmo:C1GridView>  
        <asp:AccessDataSource ID="AccessDataSource1" runat="server" 
            DataFile="~/App_Data/销售数据清单.mdb" 
            DeleteCommand="DELETE FROM [SalesData] WHERE [ID] = ?" 
            InsertCommand="INSERT INTO [SalesData] ([ID],[日期], [产品], [数量], [收入], [区域], [销售经理]) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" 
            SelectCommand="SELECT * FROM [SalesData] ORDER BY [ID] DESC" 
            UpdateCommand="UPDATE [SalesData] SET [日期] = ?, [产品] = ?, [数量] = ?, [收入] = ?, [区域] = ?, [销售经理] = ? WHERE [ID] = ?">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:Parameter Name="ID" Type="Int32" />
                <asp:Parameter Name="日期" Type="DateTime" />
                <asp:Parameter Name="产品" Type="String" />
                <asp:Parameter Name="数量" Type="Double" />
                <asp:Parameter Name="收入" Type="Double" />
                <asp:Parameter Name="区域" Type="String" />
                <asp:Parameter Name="销售经理" Type="String" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="日期" Type="DateTime" />
                <asp:Parameter Name="产品" Type="String" />
                <asp:Parameter Name="数量" Type="Double" />
                <asp:Parameter Name="收入" Type="Double" />
                <asp:Parameter Name="区域" Type="String" />
                <asp:Parameter Name="销售经理" Type="String" />
                <asp:Parameter Name="ID" Type="Int32" />
            </UpdateParameters>
        </asp:AccessDataSource>
    </div>
    </form>
</body>
</html>
